package com.peanut.wapp.persist.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.peanut.wapp.model.FeeBean;
import com.peanut.wapp.persist.FeeDao;

@Repository
public class FeeImpl extends BaseImpl implements FeeDao {
	
	final String NAME_SPACE = NAME_SPACE_HEADER + ".FeeMapper";

	@Override
	public int selectCount(String key) {
		Map<String, Object> where = new HashMap<>();
		where.put("key", key);
		return sqlSessionTemplate.selectOne(NAME_SPACE + ".selectCount", where);
	}

	@Override
	public List<FeeBean> selectList(String key, int start, int pageSize) {
		Map<String, Object> where = new HashMap<>();
		where.put("start", start);
		where.put("length", pageSize);
		where.put("key", key);
		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectList", where);
	
	}

	@Override
	public int insert(FeeBean fee) {
		return sqlSessionTemplate.insert(NAME_SPACE + ".insert", fee);
	}


}
